(library (list-helpers)
  (export flatten)

  (import
   (except (rnrs base) let-values map error)
   (only (guile)
         lambda* λ))


  (define flatten
    (λ (lst)
      (cond [(null? lst) '()]
            [(pair? lst)
             (append (flatten (car lst))
                     (flatten (cdr lst)))]
            [else
             (list lst)]))))
